#include "StdAfx.h"
#include "RelationSynopsis.h"
#include "RelationBuffer.h"

RelationSynopsis::RelationSynopsis()
{
	this->buffer.reset(new RelationBuffer());

}


RelationSynopsis::~RelationSynopsis(void)
{
}
void RelationSynopsis::insertElement(Element& element)
{
#ifdef DEBUG
	std::cout<<"@@@@@@@@relation synopsis begin@@@@@@@@@@"<<std::endl;
	std::cout<<"insert element : "<<element<<std::endl;
#endif
	 this->buffer->insertElement(element);
#ifdef DEBUG
	std::cout<<"@@@@@@@@relation synopsis end@@@@@@@@@@"<<std::endl;
#endif
}
void RelationSynopsis::deleteElement(Element& element)
{
#ifdef DEBUG
	std::cout<<"@@@@@@@@relation synopsis begin@@@@@@@@@@"<<std::endl;
	std::cout<<"delete element : "<<element<<std::endl;
#endif
	this->buffer->deleteElement(element);
#ifdef DEBUG
	std::cout<<"@@@@@@@@relation synopsis end@@@@@@@@@@"<<std::endl;
#endif
}

bool RelationSynopsis::isFull(void)
{
#ifdef DEBUG
	std::cout<<"@@@@@@@@relation synopsis begin@@@@@@@@@@"<<std::endl;
#endif
	bool bl =  this->buffer->isFull();
#ifdef DEBUG
	if(bl== true)
	{
		std::cout<<"the synopsis is full"<<std::endl;
	}
	else
	{
		std::cout<<"the synopsis is not full"<<std::endl;
	}
	std::cout<<"@@@@@@@@relation synopsis end@@@@@@@@@@"<<std::endl;
#endif
	return bl;
}